package com.kgc.entity;

import lombok.Data;

import java.util.Arrays;

/**
 * @author hyj
 * @time 2024/3/30 12:14
 * @describe 用户id 用户名 密码 邮箱 头像 创建时间 状态 积分
 */

@Data
public class User {
    private Integer userId;
    private String username;
    private String password;
    private String email;
    private String image = "https://wangkaixiang.oss-cn-hangzhou.aliyuncs.com/4586cf86-79be-4325-8d27-a888dce1c1ce.jpg";
    private String createdAt;
    private Integer status = 1;
    private Integer integral = 10;
    private String token;
    private Integer roleId;
    private Integer[] roleIds;
    private String roleName;
    private String[] roleNames;

    public User() {
    }

    public User(Integer userId) {
        this.userId = userId;
    }

    public User(Integer userId, String username, String password, String email, String image, String createdAt, Integer status, Integer integral) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.email = email;
        this.image = image;
        this.createdAt = createdAt;
        this.status = status;
        this.integral = integral;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", image='" + image + '\'' +
                ", createdAt='" + createdAt + '\'' +
                ", status=" + status +
                ", integral=" + integral +
                ", token='" + token + '\'' +
                ", roleId=" + roleId +
                ", roleIds=" + Arrays.toString(roleIds) +
                ", roleName='" + roleName + '\'' +
                ", roleNames=" + Arrays.toString(roleNames) +
                '}';
    }
}
